<%@ page contentType="text/html;charset=utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
 	 <link href="css/login.css" type="text/css" rel="stylesheet">
 	 <script src="js/jquery-3.1.0.min.js"></script>
 	 <script type="text/javascript">
	     $(document).ready(function(){ 
	    	 $("#sure").click(function(){
	    		 var flag=true;
	    		 var data="";
		     	 $(".text").each(function(){
		     		 if($(this).val()==""){
		     			 alert($(this).attr("placeholder"));
		     			 flag=false;
		     			 return false;
		     		 }
		     		 data=data+"_"+$(this).val();
		     	 });
		     	 if(flag){
		     		$.ajax({
		     			type:"post",
		     			data:{str:data},
		     			url:"confirmation.action",
		     			success:function(msg){
		     				if(msg=="fail"){
		     					alert("手机号或邮箱不正确！");
		     				}else if(msg=="erro"){
		     					alert("用户名不存在！");
		     				}else{
		     					$("#form").submit(); 
		     				}
		     			}
		     		})
	     			
	     		 }
		     });
	     });
 	 </script>
 	<style type="text/css">
 		#d01{position:absolute;left:500px;top:160px;}
 		#sure{position:absolute;left:150px;top:265px;px;}
 	</style>
</head>

	<body>
        <div id="d01">
      			
            <form  id="form" action="resetPassword.action" method="post">
             	<input class="text" type="text" id="userId" name="userId" placeholder="请输入用户名" style="width: 200px;height: 25px;"/><br/><br/><br/>
                <input class="text" type="text" id="telephone"name="telephone" placeholder="请输入注册手机" style="width: 200px;height: 25px;"/><br/><br/><br/>
                <input class="text" type="text" id="email"name="email" placeholder="请输入注册邮箱" style="width: 200px;height: 25px;"/><br/><br/><br/>
                <input class="text" type="password" name="password" placeholder="请输入新密码" style="width: 200px;height: 25px;"/><br/><br/>
                <input id="sure" type="button" value="修改密码" style="height: 25px;"/>
            </form>

        </div>
	</body>
</html>